package Pisum;

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;

/**
 * Created by wangyg on 2017/8/22.
 */
public class DefaultConnector {

    public static void connect() throws IOException, SQLException {
//        InputStream is = DefaultConnector.class.getClassLoader().getResourceAsStream("db.properties");
//        Properties properties = new Properties();
//
//        properties.load(is);
//        String url = properties.getProperty("mysql.url");
//        String pwd = properties.getProperty("mysql.password");
//        String userName = properties.getProperty("mysql.username");
        String sql="select * from account";
        String sql2="INSERT INTO account(NAME,money) VALUES(\"test\",11111);";
        HikariConfig config = new HikariConfig("/db.properties");
        HikariDataSource ds = new HikariDataSource(config);
        Connection connection = ds.getConnection();
        ResultSet resultSet = connection.createStatement().executeQuery(sql);



    }

}
